package example.demo.dp2;

public class Z2 implements Z{
    public boolean flag;

    public Z2(boolean flag) {
        this.flag = flag;
    }

    @Override
    public void doFilter(Object req, ZChain chain) {
        handle(req);
        if (flag) {
            chain.doFilter(req);
        }
    }

    @Override
    public void handle(Object req) {
        System.out.println("Z-----222");
    }
}
